package cc.rengu.igas.bomp.common.enums;

import cc.rengu.oltp.utility.util.StringUtil;

/**
 * 微信特殊行业ID
 *
 * @version 1.0
 * @date 2019/08/15
 */
public enum WechatSpecialIndustryEnum {

    E03_6381("03", "6381", "44", "保险业务"),
    E03_6399("03", "6399", "44", "保险业务"),
    E03_6300("03", "6300", "44", "保险业务"),
    E03_5960("03", "5960", "44", "保险业务"),
    E03_8351("03", "8351", "33", "民办中小学幼儿园"),
    E03_9311("03", "9311", "22", "高速公路收费"),
    E03_4900("03", "4900", "41", "水电煤气缴费"),
    E03_9222("03", "9222", "42", "交通罚款"),

    E22_9311("04", "9311", "22", "高速公路收费"),
    E41_4900("04", "4900", "41", "水电煤气缴费"),
    E42_9222("04", "9222", "42", "交通罚款"),
    E49_8099("04", "8099", "49", "公立医院"),
    E50_8220("04", "8220", "50", "公办大学及学院"),
    E51_8211("04", "8211", "51", "公办中小学幼儿园"),
    E36_8099("04", "8099", "36", "挂号平台"),
    E54_9222("04", "9222", "54", "党团费"),
    E55_8398("04", "8398", "55", "非税业务"),

    E99_8351("99", "8351", "42", "民办中小学幼儿园"),
    E99_9311("99", "9311", "42", "高速公路收费"),
    E99_4900("99", "4900", "42", "水电煤气缴费"),
    E99_9222("99", "9222", "42", "交通罚款"),
    E99_8220("99", "8220", "42", "民办大学及学院"),
    E99_8211("99", "8211", "42", "民办大学及学院"),
    E99_8398("99", "8398", "42", "公益"),

    ;

    public static String getWechatIndustryIdByMchntNatureAndIndustryType(String mchntNature, String industryType) {
        WechatSpecialIndustryEnum wechatSpecialIndustryEnum = getWechatIndustryEnumByMchntNatureAndIndustryType(mchntNature, industryType);
        if (null != wechatSpecialIndustryEnum) {
            return wechatSpecialIndustryEnum.getWechatIndustryId();
        }
        return null;
    }

    public static WechatSpecialIndustryEnum getWechatIndustryEnumByMchntNatureAndIndustryType(String mchntNature, String industryType) {
        if (StringUtil.isEmptyOrNull(mchntNature) || StringUtil.isEmptyOrNull(industryType)) {
            return null;
        }
        for (WechatSpecialIndustryEnum wechatSpecialIndustryEnum : WechatSpecialIndustryEnum.values()) {
            if (wechatSpecialIndustryEnum.getMchntNature().equals(mchntNature) && wechatSpecialIndustryEnum.getIndustryType().equals(industryType)) {
                return wechatSpecialIndustryEnum;
            }
        }


        return null;
    }

    /**
     * 商户性质
     */
    private String mchntNature;
    /**
     * 行业类别MCC
     */
    private String industryType;
    /**
     * 微信行业ID
     */
    private String wechatIndustryId;

    private String industryName;

    public String getMchntNature() {
        return mchntNature;
    }

    public String getIndustryType() {
        return industryType;
    }

    public String getWechatIndustryId() {
        return wechatIndustryId;
    }

    public String getIndustryName() {
        return industryName;
    }

    WechatSpecialIndustryEnum(String mchntNature, String industryType, String wechatIndustryId, String industryName) {
        this.mchntNature = mchntNature;
        this.industryType = industryType;
        this.wechatIndustryId = wechatIndustryId;
        this.industryName = industryName;
    }
}
